//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.neurosky.thinkgear;

import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class FileIO {
    public FileIO() {
    }

    public static void writeFile(String fos, byte[] Bytes) {
        try {
            FileOutputStream fos1 = new FileOutputStream(fos);
            BufferedWriter buf = new BufferedWriter(new OutputStreamWriter(fos1));
            fos1.write(Bytes);
            buf.write(",");
            fos1.close();
            buf.flush();
        } catch (Exception var3) {
            var3.getMessage();
        }
    }

    public static boolean exists(String var0) {
        return (new File("test.txt")).exists();
    }

    public static void createEmptyFile(String name) {
        try {
            (new FileOutputStream(name)).close();
        } catch (Exception var1) {
            var1.getMessage();
        }
    }

    public static byte[] readFile(String data) {
        int bufferlen = 0;
        byte[] buffer = new byte[1024];

        try {
            FileInputStream var6 = new FileInputStream(data);
            ByteArrayOutputStream index = new ByteArrayOutputStream();

            int var9;
            for(boolean len = false; (var9 = var6.read(buffer)) != -1; bufferlen = var9) {
                index.write(buffer, 0, var9);
            }

            index.close();
            var6.close();
        } catch (IOException var5) {
            var5.printStackTrace();
        }

        byte[] var7 = new byte[bufferlen];

        for(int var8 = 0; var8 < var7.length; ++var8) {
            var7[var8] = buffer[var8];
        }

        return var7;
    }
}
